﻿<Dropdown @ref="@_dropdown">
    <Overlay>
        <Menu OnMenuItemClicked="HandleMenuClick" AutoCloseDropdown="@false">
            <MenuItem Id="1">Clicking me will not close the menu.</MenuItem>
            <MenuItem Id="2">Clicking me will not close the menu also.</MenuItem>
            <MenuItem Id="3">Clicking me will close the menu.</MenuItem>
        </Menu>
    </Overlay>
    <ChildContent>
        <a class="ant-dropdown-link" @onclick:preventDefault>
            Hover me <Icon Type="down" />
        </a>
    </ChildContent>
</Dropdown>

@code
{
    private Dropdown _dropdown;

    private async void HandleMenuClick(MenuItem item)
    {
        if (item.Id == "3")
        {
           await _dropdown.Close();
        }
    }
}